<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="verydows-baseurl" content="<{$common.baseurl}>">
<meta name="keywords" content="注册, 用户注册, 会员注册" />
<meta name="description" content="Verydows 免费开源的电子商务系统 - 使用 Verydows 轻松创建属于您自己的网上商城。 Verydows 致力于为全球企业和个人打造免费、开源、专业、强大的电商平台系统！" />
<title>用户注册 - <{$GLOBALS.cfg.site_name}></title>
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/general.css" />
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/login.css" />
<script type="text/javascript" src="<{$common.baseurl}>/public/script/jquery.js"></script>
<script type="text/javascript" src="<{$common.theme}>/js/general.js"></script>
<script type="text/javascript">
function register(btn){
  $('#username').vdsFieldChecker({
    rules:{required:[true, '请设置用户名'], username:[/^[a-zA-Z][_a-zA-Z0-9]{4,15}$/.test($('#username').val()), '用户名不符合格式要求']},
    tipsPos:'abs',
  });
  $('#email').vdsFieldChecker({
    rules:{required:[true, '请设置邮箱'], email:[true, '无效的邮箱地址'], maxlen:[60, '邮箱地址不能超过60个字符']}, 
    tipsPos:'abs',
  });
  $('#password').vdsFieldChecker({
    rules:{required:[true, '请设置密码'], password:[true, '密码不符合格式要求']}, 
    tipsPos:'abs',
  });
  $('#repassword').vdsFieldChecker({
    rules:{equal:[$('#password').val(), '两次密码不一致']}, 
    tipsPos:'abs',
  });
  if($('#captcha').size() > 0){
    $('#captcha').vdsFieldChecker({rules: {required:[true, '请输入验证码']}});
  }
  $('#agree').vdsFieldChecker({
    rules:{agree:[$('#agree').prop('checked'), '必须阅读并同意用户注册协议']}, 
    tipsPos:'abs',
  });
  
  $('#register-form').vdsFormChecker({
    beforeSubmit: function(){
      $(btn).addClass('disabled').text('正在提交...').prop('disabled', true);
    }
  });
}

function resetCaptcha(){
  var src = "<{url c='api/captcha' a='image' v='random'}>";
  $('#captcha-img').attr('src', src.replace('random', Math.random()));
  $('#captcha').focus();	
}
</script>
</head>
<body>
<!-- 头部开始 -->
<div class="header">
  <div class="w900 mt30 cut">
    <div class="logo"><a href="<{url c='main' a='index'}>"><img src="<{$common.theme}>/images/logo.gif" /></a></div>
  </div>
</div>
<!-- 头部结束 -->
<!-- 主体开始 -->
<div class="container w900 mt20">
  <div class="wbox cut">
    <div class="signup cut">
      <div class="th module cut">
        <h2 class="fl">注册新用户</h2>
        <div class="fr">已注册了账号？ 请直接 <a href="<{url c='user' a='login'}>">登陆</a></div>
      </div>
      <form method="post" action="<{url c='user' a='register' step='submit'}>" id="register-form">
        <div class="form cut">
          <dl>
            <dt><label for="username">用户名：</label></dt>
            <dd>
              <input name="username" id="username" type="text" data-warnpos="fixed" />
              <p class="caaa mt5">用户名可以包含字母、数字或下划线，须以字母开头，长度为5~16个字符</p>
            </dd>
          </dl>
          <dl>
            <dt><label for="email">邮箱：</label></dt>
            <dd>
              <input name="email" id="email"  type="text" placeholder="@" data-warnpos="fixed" />
              <p class="caaa mt8">请填写您常用的电子邮箱地址，邮箱可用来重置密码，接收订促销信息，订单状态等</p>
            </dd>
          </dl>
          <dl>
            <dt><label for="password">设置密码：</label></dt>
            <dd>
              <input name="password" id="password" type="password" data-warnpos="fixed" />
              <p class="caaa mt8">密码可包含字母、数字或特殊符号，长度为6~32个字符</p>
            </dd>
          </dl>
          <dl>
            <dt><label for="repassword">确认密码：</label></dt>
            <dd>
              <input name="repassword" id="repassword" type="password" data-warnpos="fixed" />
              <p class="caaa mt8">确认您所设置的密码</p>
            </dd>
          </dl>
          <{if !empty($GLOBALS.cfg.captcha_user_register)}>
          <dl class="captcha">
            <dt>验证码：</dt>
            <dd>
              <input name="captcha" id="captcha" type="text" />
              <a onclick="resetCaptcha()"><i class="refresh icon"></i><font class="ml5">点击刷新</font></a>
            </dd>
          </dl>
          <div class="ml80"><img id="captcha-img" src="<{url c='api/captcha' a='image'}>" /></div>
          <{/if}>
          <div class="agreement mt30 ml80 c666">
            <label><input name="agree" id="agree" type="checkbox" checked="checked" /><font class="ml5">已阅读完并同意 <a href="#">"用户注册协议"</a></font></label>
          </div>
          <div class="sutr mt20 ml80"><a href="javascript:void(0)" class="form-submit aln-c radius4" onclick="register(this)">立即注册</a></div>
        </div>
      </form>
    </div>
  </div>
</div>
<!-- 主体结束 -->
<div class="cl"></div>
<!-- 页脚开始 -->
<{layout_footer}>
<!-- 页脚结束 -->
</body>
</html>